#ifndef _SHIELD_
#define _SHIELD_

#include "aerial\Core\base.h"
#include "aerial\Game\GameObject\Equipment\Equipment.h"

#include "hge\hge.h"
#include "hge\hgesprite.h"
#include "hge\hgeresource.h"
//#include "hge\hgeparticle.h"

using namespace air;

class FlyObject;

class Shield: public Equipment
{
	enum ShieldState { Expanding, Full, Contracting, Off };
public:
	static bool available(FlyObject*);
	/**
	 * @brief construct a shield
	 *
	 * @param _radius specify the max size of a shield
	 * @param _host specify which flyobject control this shield
	 */
	Shield(float _radius, FlyObject* _host);
	~Shield() {}
	/**
	 * @brief rendering the shield
	 * 
	 * @param horizontal position of the shield
	 * @param vertical position of the shield
	 */
	void renderShield(float x, float y);
	bool update(float dt);

	bool isOn();
	bool ShieldOn();
	void ShieldOff();
	float GetPercentage() { return shield_scale / max_shield_radius; }
private:
	ShieldState shieldState;

	float x, y;

	float halo_scale;
	float shield_scale;

	float max_shield_radius;
	float min_power;

	hgeSprite *sprShield;

	FlyObject* host;
	static const float MinPower;
	static const float PCPS;
};

#endif